<!doctype html>
<!--CKYLINMC-WORKS-->
<html>

<head>
    <title>Loading...</title>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta name="author" content="CKylinMC" />
    <meta http-equiv="keywords" content="TruthOrDareQuestions">
    <meta http-equiv="description" content="TruthOrDareQuestions site">
    <script>
        (function (window) {
            window.data = {
                version: '1.0.1',
                updateNote: `
                    <h2>更新日志 (v1.0.1)</h2>
                    2020年11月22日
                    <ul>
                        <li>添加复制按钮</li>
                        <li>支持为语料添加描述</li>
                        <hr>
                        <li>删除无用代码，提高执行效率</li>
                        <li>优化标签显示效果</li>
                        <li>增加当前筛选条数展示</li>
                        <li>增加更新日志提示</li>
                    </ul>
                `,
                curr: "none",
                addr: {
                    zxh: "https://cdn.jsdelivr.net/gh/CKylinMC/TOD_Dict@main/questions.json",
                    dmx: "https://cdn.jsdelivr.net/gh/CKylinMC/TOD_Dict@main/actions.json"
                },
                zxh:{},
                dmx:{},
                include:[],
                exclude:[]
            }
            window.page = {
                loaded: false,
                superTheme: false,
                isIndex: false,
                prevPage: "",
                prevPageBtnAlwaysShow: true,
                startload: new Date().valueOf(),
                endload: new Date().valueOf(),
                loadtiming: 0,
                title: "Document by CKylin",
                url: location.href,
                onload: () => {},
                autoexecs: [],
                callback: (func) => {
                    if (func instanceof Function) {
                        if(page.loaded) func.apply();
                        window.page.autoexecs.push(func);
                    } else console.error(func, "Can not reg as callback: not a function.");
                }
            };
        })(window);
    </script>
    <link rel="stylesheet" href="/assets/css/style.css">
    <link rel="stylesheet" href="/assets/css/TODStyles.css">
    <link rel="stylesheet" href="/assets/css/modal.css">
    <link rel="stylesheet" href="/assets/css/PopNotify.css">
    <link rel="stylesheet" href="/assets/css/tips.css">
</head>

<body>
    <header>
        <span class="site-name" onclick="location.href='/'">真心话大冒险 <small style="font-weight: lighter;font-size: small;">在线版</small></span>
    </header>
    <div class="container loader" id="load-pending">
        <div style="
        font-size: xx-large;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%,-50%);
    ">
            <span class="loading-spinner" style="
            width: 36px;
            height: 36px;
        "> </span>
            <span class="texttip">正在加载...</span>
        </div>
    </div>
    <div class="container hidden" id="content-container">
        <h1>真心话大冒险</h1>


        <h3>输入参与人名称</h3>
        <div class="game-container">
            <ul id="game-names" class="multi-column-menu">
                
            </ul>
            <div class="game-btns">
            <button id="game-reset" onclick="resetGame()" class="red">重置</button>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <button onclick="Game_Go()" id="game-go">❤️ Go! ⚔️</button>
            </div>
            <div class="game-space">&nbsp;</div>
            <div id="game-result" class="hide">&nbsp;</div>
        </div>


        <h3>快速生成真心话问题或者大冒险要求！</h3>

        <ul class="multi-column-menu">
            <li><a href="javascript:void(0)" onclick="zxh()"
                    style="font-size: 1.4rem;font-weight: bold;text-align:center">❤️ 真心话</a></li>
            <li><a href="javascript:void(0)" onclick="dmx()"
                    style="font-size: 1.4rem;font-weight: bold;text-align:center">⚔️ 大冒险</a></li>
        </ul>
    </div>
    <div id="card-container">

    </div>
    <template id="temp-zxh">
        <div class="container hidden" id="card2">
            <h1>❤️ 真心话 <span class="counter"></span></h1>
            <div class="exclude-tags hide"></div>
            <div class="include-tags hide"></div>
            <div class="container-btns">
                <button onclick="resetFilter()" class="s-resetfilter s-hide red">重置筛选</button>
                <button onclick="randomOne()" class="s-random s-hide">🎲 随机</button>
            </div>
            <div id="zxh-container" class="s-container">
            </div>
        </div>
    </template>
    <template id="temp-dmx">
        <div class="container hidden" id="card2">
            <h1>⚔️ 大冒险 <span class="counter"></span></h1>
            <div class="exclude-tags"></div>
            <div class="include-tags"></div>
            <div class="container-btns">
                <button onclick="resetFilter()" class="s-resetfilter s-hide red">重置筛选</button>
                <button onclick="randomOne()" class="s-random s-hide">🎲 随机</button>
            </div>
            <div id="dmx-container" class="s-container">
            </div>
        </div>
    </template>

    <div class="helpbtn" onclick="helpModal()">?</div>

    <div class="top hide" onclick="goTop()">↑</div>

    <div class="random-btn" onclick="randomOne()">🎲</div>

    <script>
        page.title = "真心话大冒险 网页版";
        // page.url = "/index.html";
        page.isIndex = true;
        

        page.callback(function () {
            loadCard2();
        });

        page.callback(function () {
            resetGame();
        });

        page.callback(function () {
            if(!localStorage.notFirstTime){
                localStorage.notFirstTime = 1;
                localStorage.version = window.data.version;
                helpModal();
            }
            if(localStorage.version!=window.data.version){
                localStorage.version = window.data.version;
                updateNote();
            }
        });

        window.onscroll = e=>{
            let topbtn = get(".top");
            if(!topbtn) return;
            if(pageYOffset>200){
                if(topbtn.classList.contains("hide"))topbtn.classList.remove("hide");
            }else{
                if(!topbtn.classList.contains("hide"))topbtn.classList.add("hide");
            }
        }

        function goTop(){
            scrollTo({ 
                top: 0, 
                behavior: "smooth" 
            });
        }

        function tip(e, t) {
            let el = e instanceof HTMLElement ? e : e.target;
            let title = "";
            if (el) {
                title = el.innerHTML;
            }
            openModal(modalTitle(title) + t, "success", "关闭提示");
        }
    </script>
    <footer>
        推荐在电脑中使用Chrome、Firefox浏览器访问<br>
        <a href="https://github.com/CKylinMC/TOD_Web/issues/new/choose">反馈页面bug</a><br>
        <a href="https://github.com/CKylinMC/TOD_Dict/issues/new/choose">添加新的词条</a><br>
        <span id="busuanzi_container_site_pv">本站总访问量<span id="busuanzi_value_site_pv"></span>次</span><br>
        <a href="https://github.com/CKylinMC/TOD_Web">CKylinMC</a> &copy; 2020
    </footer>
    <script src="/assets/js/CKFetch.js"></script>
    <script src="/assets/js/PopNotify.js"></script>
    <script src="/assets/js/tips.js"></script>
    <script src="/assets/js/modal.js"></script>
    <script src="/assets/js/common.js"></script>
    <script src="/assets/js/game.js"></script>
    <script src="/assets/js/loadCard.js"></script>
    <script src="/assets/js/errorcatcher.js"></script>
    <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <script>
        initModal();
        initTips();
        var tipsShow;
        if (tipsShow = getUrlParam("show")) {
            showTips(tipsShow);
        }
    </script>
    <script>
        (function (window, document) {
            if ("page" in window) {
                let lp = get("#load-pending");
                if (lp) {
                    lp.classList.add("hidden");
                }
                let cc = get("#content-container");
                if (cc) {
                    cc.classList.remove("hidden");
                    cc.classList.add("anim-in");
                }

                if (window.page.onload instanceof Function) {
                    window.page.onload();
                }
                window.page.endload = new Date().valueOf();
                document.title = window.page.title;
                setCurrentPath(window.page.url);
                window.page.loadtiming = (window.page.endload - window.page.startload) / 1000;
                console.info("[LOAD TIME] 网页加载耗时 " + window.page.loadtiming + " 秒");

                page.autoexecs.forEach(e => {
                    try {
                        e.apply();
                    } catch (err) {
                        console.error("Errored while executing callback function\n", e,
                            "\n\nThe error is: ", err);
                    }
                });
                page.loaded = true;
            }
        })(window, document);
    </script>
</body>

</html>